#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(int argc, char *argv[])
{
    // 输入三角形的三条边， 计算三角形的面积
    float a, b, c, p, result;

    printf("Please enter a,b,c for a triangle:\n");
    scanf("%f%f%f", &a, &b, &c);

    if( (a + b) < c ||
            (a + c) < b ||
            (b + c) < a
      ) {
        printf("those three numbers can not be a triangle: %.2f %.2f %.2f\n", a, b, c);
    } else if (
            (abs(a - b)) > c ||
            (abs(a - c)) > b ||
            (abs(b - c)) > a
            ) {
        printf("those three numbers can not be a triangle: %.2f %.2f      %.2f\n", a, b, c);
    } else {

        p = (a + b + c) / 2;
        result = sqrt(p * (p - a) * (p - b) * (p - c));
        printf("the area of this triangle is: %.2f\n", result);
    }

    printf("\n");
    return 0;
}
